You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(evolution): resolve committee cert redeemers to their certificate index (#518) - #642
Fixes#518. authCommitteeHot and resignCommitteeCold store a Plutus-script committee cold credential's redeemer under cert:{coldCredentialHash}, but the certificate lookup that resolves that key to a certificate index never checked committeeColdCredential, so the redeemer was dropped and the transaction could not be built.
The lookup exists in two places, and both had the same gap:
txBuilder.ts: the cert index lookup matched only stakeCredential and drepCredential; an unresolved key logged a warning and the redeemer was skipped. (On current main this lookup lives in the shared makeRedeemerIndexer helper, which assembly and the fee estimate both use — the fix sits there, so both now resolve committee cert redeemers to the same index.)
Evaluation.ts (script evaluation): the certificate index map was built from the same two fields, so evaluation never associated the redeemer with a purpose either — in practice the build failed there first, with Evaluation returned zero results despite having … once the assembled pre-evaluation transaction came back with no cert redeemer for the evaluator to price.
Both now also match committeeColdCredential (the credential on AuthCommitteeHotCert and ResignCommitteeColdCert), in the same shape as the existing branches.
Deliberately left out
The issue's second suggestion — failing instead of warning when a cert redeemer cannot be resolved. Warn-and-continue is the shared behaviour of that assembly loop for every redeemer tag (mint, cert, reward, vote), so changing the failure semantics for cert alone is a broader behaviour change than the index fix; I left it for maintainer direction rather than deciding it in this PR. After this fix, a committee cert redeemer resolves, so the warning path is only reachable for a key that names no certificate at all.
Tests
New file TxBuilder.PlutusCCCert.test.ts (4 tests), all verified red on main first, one at a time:
Plutus-script authCommitteeHot with a redeemer: on main the build failed in evaluation; after the fix it emits one cert redeemer at index 0 with the evaluator's ExUnits, the Plutus V3 script in the witness set, and a script data hash.
Index positioning: a key-hash authCommitteeHot first and the Plutus one second — the redeemer is emitted at index 1 (the committee certificate's own index), with the ExUnits the evaluator returned for index 1.
Plutus-script resignCommitteeCold with a redeemer: one cert redeemer at index 0.
Control (passes on main too): a key-hash cold credential emits no redeemer, even when one is supplied — native-script and key-hash committee flows are unchanged (the existing TxBuilder.NativeScriptCCCert suite also still passes).
Full suite: 1747 passed / 75 skipped / 0 failed (109 test files: 108 passed, 1 skipped) — current main's 1743 baseline plus the 4 new tests. tsc --noEmit and eslint clean; a patch changeset is included.
Built and maintained by Kyle Cox — independent Cardano builder.
𝕏 @Kshot9000 (https://x.com/kshot9000) · GitHub https://github.com/Kshot3000
ADA: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
Not affiliated with the Cardano Foundation, IOG, or Intersect. Tagging @cardano-foundation and @IntersectMBO for visibility.
Rebased onto current main (c63f5eb) — this PR had gone conflicting after #652/#654/#655/#656/#658 landed in the same files.
The rebase was not purely mechanical: upstream refactored the assembly loop's inline index lookups into a shared makeRedeemerIndexer helper in txBuilder.ts, used by both assembly and the fee estimate. The committee-cold-credential check now sits in that helper's cert case, in the same shape as the existing stake/DRep branches, so assembly and fee sizing resolve the same index. The Evaluation.ts half of the fix is unchanged — upstream did not touch that file. I also re-verified the fix is still needed on current main: nothing upstream resolves committeeColdCredential to a certificate index.
Re-verification on the rebased branch:
The 4 tests in TxBuilder.PlutusCCCert.test.ts pass; checked one at a time against current main without the fix, the three behavioural tests fail there (the build fails in evaluation with "Evaluation returned zero results") and the key-hash control passes both ways, as before.
Full suite: 1747 passed / 75 skipped / 0 failed (109 test files) — current main's 1743 baseline plus the 4 new tests. tsc --noEmit and eslint clean; prettier drift on the two touched source files is unchanged from main.
Built and maintained by Kyle Cox — independent Cardano builder.
𝕏 @Kshot9000 (https://x.com/kshot9000) · GitHub https://github.com/Kshot3000
ADA: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
Not affiliated with the Cardano Foundation, IOG, or Intersect. Tagging @cardano-foundation and @IntersectMBO for visibility.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #518.
authCommitteeHotandresignCommitteeColdstore a Plutus-script committee cold credential's redeemer undercert:{coldCredentialHash}, but the certificate lookup that resolves that key to a certificate index never checkedcommitteeColdCredential, so the redeemer was dropped and the transaction could not be built.The lookup exists in two places, and both had the same gap:
txBuilder.ts: the cert index lookup matched onlystakeCredentialanddrepCredential; an unresolved key logged a warning and the redeemer was skipped. (On current main this lookup lives in the sharedmakeRedeemerIndexerhelper, which assembly and the fee estimate both use — the fix sits there, so both now resolve committee cert redeemers to the same index.)Evaluation.ts(script evaluation): the certificate index map was built from the same two fields, so evaluation never associated the redeemer with a purpose either — in practice the build failed there first, withEvaluation returned zero results despite having …once the assembled pre-evaluation transaction came back with no cert redeemer for the evaluator to price.Both now also match
committeeColdCredential(the credential onAuthCommitteeHotCertandResignCommitteeColdCert), in the same shape as the existing branches.Deliberately left out
The issue's second suggestion — failing instead of warning when a cert redeemer cannot be resolved. Warn-and-continue is the shared behaviour of that assembly loop for every redeemer tag (mint, cert, reward, vote), so changing the failure semantics for cert alone is a broader behaviour change than the index fix; I left it for maintainer direction rather than deciding it in this PR. After this fix, a committee cert redeemer resolves, so the warning path is only reachable for a key that names no certificate at all.
Tests
New file
TxBuilder.PlutusCCCert.test.ts(4 tests), all verified red on main first, one at a time:authCommitteeHotwith a redeemer: on main the build failed in evaluation; after the fix it emits onecertredeemer at index 0 with the evaluator's ExUnits, the Plutus V3 script in the witness set, and a script data hash.authCommitteeHotfirst and the Plutus one second — the redeemer is emitted at index 1 (the committee certificate's own index), with the ExUnits the evaluator returned for index 1.resignCommitteeColdwith a redeemer: onecertredeemer at index 0.TxBuilder.NativeScriptCCCertsuite also still passes).Full suite: 1747 passed / 75 skipped / 0 failed (109 test files: 108 passed, 1 skipped) — current main's 1743 baseline plus the 4 new tests.
tsc --noEmitand eslint clean; a patch changeset is included.Built and maintained by Kyle Cox — independent Cardano builder.
𝕏 @Kshot9000 (https://x.com/kshot9000) · GitHub https://github.com/Kshot3000
ADA: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
Not affiliated with the Cardano Foundation, IOG, or Intersect. Tagging @cardano-foundation and @IntersectMBO for visibility.